package com.aso114.project.base;

import com.aso114.project.adapter.ModuleExamAdapter;
import com.chad.library.adapter.base.entity.AbstractExpandableItem;
import com.chad.library.adapter.base.entity.MultiItemEntity;
import com.google.gson.annotations.SerializedName;

import java.util.List;

/**
 * @author lin
 * @description: 章节练习实体
 * @date 2019/3/11 0011
 */
public class ModuleExamBean extends AbstractExpandableItem<ModuleExamBean> implements MultiItemEntity {

    /**
     * ParentId : 2034
     * SpecialId : 2035
     * SpecialTitle : 职业理念
     * SpecialLevel : 1
     * RealCount : 0
     * RealAnswerCount : 51
     * RealAnswerStateCount : 0
     * TotalQuestions : 97
     * QuestionUserList : [{"ParentId":"2035","SpecialId":"2036","SpecialTitle":"教育观","SpecialLevel":"2","RealCount":0,"RealAnswerCount":"20","RealAnswerStateCount":"0","TotalQuestions":"16","QuestionUserList":[{"ParentId":"2036","SpecialId":"2037","SpecialTitle":"素质教育概述","SpecialLevel":"3","RealCount":0,"RealAnswerCount":"14","RealAnswerStateCount":"0","TotalQuestions":"7"},{"ParentId":"2036","SpecialId":"2038","SpecialTitle":"素质教育的实施与推进","SpecialLevel":"3","RealCount":0,"RealAnswerCount":"3","RealAnswerStateCount":"0","TotalQuestions":"3"},{"ParentId":"2036","SpecialId":"2039","SpecialTitle":"素质教育的内容目标及实施素质教育的途径与方法","SpecialLevel":"3","RealCount":0,"RealAnswerCount":"3","RealAnswerStateCount":"0","TotalQuestions":"1"}]},{"ParentId":"2035","SpecialId":"2040","SpecialTitle":"学生观","SpecialLevel":"2","RealCount":0,"RealAnswerCount":"8","RealAnswerStateCount":"0","TotalQuestions":"27","QuestionUserList":[{"ParentId":"2040","SpecialId":"2041","SpecialTitle":"\u201c以人为本\u201d学生观","SpecialLevel":"3","RealCount":0,"RealAnswerCount":"8","RealAnswerStateCount":"0","TotalQuestions":"23"},{"ParentId":"2040","SpecialId":"2042","SpecialTitle":"教育公正与学生发展","SpecialLevel":"3","RealCount":0,"RealAnswerCount":"0","RealAnswerStateCount":"0","TotalQuestions":"1"}]},{"ParentId":"2035","SpecialId":"2043","SpecialTitle":"教师观","SpecialLevel":"2","RealCount":0,"RealAnswerCount":"4","RealAnswerStateCount":"0","TotalQuestions":"51","QuestionUserList":[{"ParentId":"2043","SpecialId":"2044","SpecialTitle":"教师职业概述","SpecialLevel":"3","RealCount":0,"RealAnswerCount":"1","RealAnswerStateCount":"0","TotalQuestions":"13"},{"ParentId":"2043","SpecialId":"2045","SpecialTitle":"教师专业发展","SpecialLevel":"3","RealCount":0,"RealAnswerCount":"2","RealAnswerStateCount":"0","TotalQuestions":"8"},{"ParentId":"2043","SpecialId":"2046","SpecialTitle":"新课程背景下的教师观与终身学习","SpecialLevel":"3","RealCount":0,"RealAnswerCount":"1","RealAnswerStateCount":"0","TotalQuestions":"17"}]}]
     */

    private boolean lastIndex;

    @SerializedName("ParentId")
    private String parentId;

    @SerializedName("SpecialId")
    private String specialId;

    @SerializedName("SpecialTitle")
    private String specialTitle;

    @SerializedName("SpecialLevel")
    private String specialLevel;

    @SerializedName("RealCount")
    private int realCount;

    @SerializedName("RealAnswerCount")
    private int realAnswerCount;

    @SerializedName("RealAnswerStateCount")
    private int realAnswerStateCount;

    @SerializedName("TotalQuestions")
    private int totalQuestions;

    @SerializedName("QuestionUserList")
    private List<ModuleExamBean> questionUserList;

    public boolean isLastIndex() {
        return lastIndex;
    }

    public void setLastIndex(boolean lastIndex) {
        this.lastIndex = lastIndex;
    }

    public String getParentId() {
        return parentId;
    }

    public void setParentId(String parentId) {
        this.parentId = parentId;
    }

    public String getSpecialId() {
        return specialId;
    }

    public void setSpecialId(String specialId) {
        this.specialId = specialId;
    }

    public String getSpecialTitle() {
        return specialTitle;
    }

    public void setSpecialTitle(String specialTitle) {
        this.specialTitle = specialTitle;
    }

    public String getSpecialLevel() {
        return specialLevel;
    }

    public void setSpecialLevel(String specialLevel) {
        this.specialLevel = specialLevel;
    }

    public int getRealCount() {
        return realCount;
    }

    public void setRealCount(int realCount) {
        this.realCount = realCount;
    }

    public int getRealAnswerCount() {
        return realAnswerCount;
    }

    public void setRealAnswerCount(int realAnswerCount) {
        this.realAnswerCount = realAnswerCount;
    }

    public int getRealAnswerStateCount() {
        return realAnswerStateCount;
    }

    public void setRealAnswerStateCount(int realAnswerStateCount) {
        this.realAnswerStateCount = realAnswerStateCount;
    }

    public int getTotalQuestions() {
        return totalQuestions;
    }

    public void setTotalQuestions(int totalQuestions) {
        this.totalQuestions = totalQuestions;
    }

    public List<ModuleExamBean> getQuestionUserList() {
        return questionUserList;
    }

    public void setQuestionUserList(List<ModuleExamBean> questionUserList) {
        this.questionUserList = questionUserList;
    }

    @Override
    public int getLevel() {
        return Integer.valueOf(getSpecialLevel()) - 1;
    }

    @Override
    public int getItemType() {
        //都是同一类型，通用itemType
        return ModuleExamAdapter.TYPE_COMMON;
    }

    /**
     * 复写父类方法，此方法用于获取当前子节点数据
     *
     * @return 子节点数据
     */
    @Override
    public List<ModuleExamBean> getSubItems() {
        return getQuestionUserList();
    }
}
